import request from '@/utils/request'

/* 公告接口 */

// 分页
export function getAnnouncementPage(data) {
  return request({
    url: '/announcement/page',
    method: 'post',
    data
  })
}

// 删除
export function deleteAnnouncementById(id) {
  return request({
    url: `/announcement/${id}`,
    method: 'delete'
  })
}

// 新增
export function addAnnouncement(data) {
  return request({
    url: '/announcement',
    method: 'post',
    data
  })
}

// 详情
export function getAnnouncementDetailById(id) {
  return request({
    url: `/announcement/${id}`,
    method: 'post'
  })
}

// 修改
export function updateAnnouncement(data) {
  return request({
    url: '/announcement',
    method: 'put',
    data
  })
}
